﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace YouHP.Model
{
    [Serializable]
public class IndicatorHistoryInfo : IHydratable
    {
        public int Id { get; set; }
        public int PRId { get; set; }                   /*病人患病记录id*/
        public int DiseaseId { get; set; }
        public int IndicatorId { get; set; }
        public string IndicatorName { get; set; }
        public double DataValue { get; set; }           /*检测值*/
        public string MeasurementUnits { get; set; }    /*计量单位*/
        public int SurveyId { get; set; }               /*对应的SurveyId*/
        public DateTime RecordDate { get; set; }        /*纪录时间（病人数据对应的真实时间）*/
        public DateTime UpdateDate { get; set; }        /*提交时服务器当前时间*/
        public string Remark { get; set; }

        public int IndicatorHistoryId { get; set; }

        public IndicatorHistoryInfo()
        {
            Id = PRId = IndicatorId = DiseaseId = SurveyId = IndicatorHistoryId  = - 1;
            DataValue = 0.0;

            Remark = "";
        }

        #region IHydratable 成员
        public bool Fill(System.Data.IDataReader dr)
        {
            return false;
        }
        #endregion  
    }
    public class IndicatorHistoryInfoComparer : IComparer<IndicatorHistoryInfo>
    {
        public int Compare(IndicatorHistoryInfo X, IndicatorHistoryInfo Y)
        {
            if (X.RecordDate == Y.RecordDate)
            {
                return 0;
            }
            else if (X.RecordDate > Y.RecordDate)
            {
                return 1;
            }
            else
            {
                return -1;
            }
        }

    }
}
